using System.Linq;
using PersonalAccoutingProgram.Data;

namespace PersonalAccoutingProgram.Data
{
    partial class OriginDataClassesDataContext
    {
        public static IQueryable<int> GetAllOriginesID(string origin)
        {
            IncomeDataClassesDataContext incomesDC =
            new IncomeDataClassesDataContext();
            var originID =
            from currentOrigin in incomesDC.GetTable<Origin>()
            where currentOrigin.OriginName == origin
            select currentOrigin.OriginID;
            return originID;
        }

        public static IQueryable<string> GetAllOrigines()
        {
            OriginDataClassesDataContext originDC =
            new OriginDataClassesDataContext();
            var allCategories =
            from currentOrigin in originDC.GetTable<Origin>()
            select currentOrigin.OriginName;
            return allCategories;
        }
    }
}